package com.will.controller;

import com.will.client.NettyClient;
import com.will.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 杨明智
 * @version:1.0
 * @create 2019年01月04日 3:29 PM
 * @description
 **/
@Api(value="测试的接口", tags= {"测试的controller"})
@RequestMapping("/comm1")
@RestController
public class MyController {
    @Autowired
    private NettyClient nettyClient;


    @ApiOperation(value="测试", notes="测试的接口")
    @GetMapping("/processreq")
    public String processReq(@RequestParam("str") String str) throws Exception{
        User leader = new User();
        leader.setId(1);
        leader.setName("上级");
        leader.setSource(100);
        User user = new User();
        user.setSource(80);
        user.setId(0);
        user.setName("基层");
        user.setLeader(leader);
        nettyClient.sendObjectMsg(user);
        return "success";
    }


}
